package com.sf.web.controller;

import com.alibaba.druid.pool.DruidDataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.sql.DataSource;

@Controller
public class HelloController {
    @RequestMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello springboot";
    }


    /**
     * 连接德鲁伊连接池   自动配置
     */
//    @Autowired
//    private DataSource dataSource;
//
//   @RequestMapping("/getUsername")
//    @ResponseBody
//    public String getUsername(){
//       DruidDataSource druidDataSource=(DruidDataSource) dataSource;
//       return druidDataSource.getUsername();
//   }


}
